@extends('front.layout')
@section('title','首页')
@section('index','class=current')
@section('content')
    <div class="index_top clearfix">
        <div class="index_left">
            <div class="index_left_bg"><img src="/res/images/last_time_bg.jpg"/></div>
            <div class="index_left_body">
            @if($cnt>0)
                <!-- 后面获取时间后判断是未开始还是进行中-->
                    <?php
                    $start = \Illuminate\Support\Carbon::parse($oVideo->start_at);
                    $now = \Illuminate\Support\Carbon::now();
                    ?>
                    @if($now < $start)
                        <div class="before">
                            <div class="last_time">
                                <span class="time1"></span>
                                <span class="time2"></span>
                                <span class="time3"></span>
                                <span class="time4"></span>
                            </div>
                            <a class="class_href" href="#"></a>
                        </div>
                    @else
                    <!--会议进行中-->
                        <div class="meeting">
                            <a href="#">
                                <img src="/res/images/online_classing.png"/>
                            </a>
                        </div>
                    @endif
                @else
                <!--会议结束-->
                    <div class="end_title">会议已结束</div>
                @endif
                <div class="left_share">
                    <span>分享到：</span>
                    <a href="javascript:void(0)" onclick="erweima()"><img src="/res/images/icon_weixin.jpg"/></a>
                </div>
            </div>
        </div>
        <div class="index_right">
            <div class="title_box">专家介绍</div>
            <div class="index_right_list">
                @foreach($oExperts as $v)
                    <div class="index_right_ship clearfix">
                        <div class="index_right_img">
                            <a href="/expert/info/{{$v->id}}"><img src="{{$v->thumb}}"/></a>
                        </div>
                        <div class="index_right_txt">
                            <p>专家: {{$v->name}}</p>
                            <p>职位: {{$v->position}}</p>
                            <p>医院: {{$v->hospital}}</p>
                            <p><a href="/expert/info/{{$v->id}}">详细</a></p>
                        </div>
                    </div>
                @endforeach
                <div class="index_right_more"><a href="/expert">more+</a></div>
            </div>
        </div>
    </div>
    <div class="review">
        <div class="title_box">精彩回顾</div>
        <div class="review_list">
            <div class="one_line clearfix">
                @foreach($oVideos as $v)
                    <div class="one_line clearfix">


                    <div class="review_ship mar_0" style="margin-right: 30px">
                        <div class="review_ship_img">
                            <a href="/video/info/{{$v->id}}">
                                <img src="{{$v->thumb}}"/>
                            </a>
                        </div>
                        <div class="review_ship_txt">
                            <div class="review_ship_title break"><a href="/video/info/{{$v->id}}">{{$v->name}}</a></div>
                            <div class="review_ship_intro clearfix">
                                <div class="review_ship_left">
                                    <p>主持：<a href="/d/info/{{$v->expert->id}}">{{$v->expert->name}}</a></p>
                                    <p>日期：<span class="txt_999">{{$v->end_at}}</span></p>
                                </div>
                                <div class="review_ship_right">
                                    <a class="info_btn" href="/video/info/{{$v->id}}">查看详情</a>
                                </div>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>

    <script>
        var starttime = new Date('{{$cnt>0?$oVideo->start_at:''}}');
        function count_down() {
            var nowtime = new Date();
            var time = starttime - nowtime;
            if(time<=0){
                clearInterval(id);

            }
            var day = parseInt(time / 1000 / 60 / 60 / 24);
            var hour = parseInt(time / 1000 / 60 / 60 % 24);
            var minute = parseInt(time / 1000 / 60 % 60);
            var seconds = parseInt(time / 1000 % 60);
            $('.time1').html(day);
            $('.time2').html(hour);
            $('.time3').html(minute);
            $('.time4').html(seconds);
        }
        var id = setInterval(count_down, 1000);
    </script>
    <div id="char_pop" class="chat_pop" style="display: none">
        <div id="char_close" class="chat_pop_top"><a onclick="Pop_close()" class="chat_pop_close"></a></div>
        <div class="chat_pop_body">
            <img src="/res/images/1.png" />
            <p>使用微信扫一扫，并将网页分享给好友</p>
        </div>
    </div>
    <script>
        function erweima(){
            $.blockUI({
                message:$("#char_pop"),
                css:{border:'none'}
            });
        }
        function Pop_close(){
            $.unblockUI();
        }

    </script>


@endsection

